import server from '../../public/server.js'
import api from '../../public/api.js'

Page({
  data:{
    value:"",
    rTxt:""
  },
  onLoad() {
    //this.getInfo();
  },
  getInputTxt(e){
    this.setData({
      value: e.detail.value
    })
  },
  handleClick(){
    console.log()
    if (this.data.value == ""){
      return;
    }
      
    this.getInfo();

  },
  //字体转换
  getInfo() {
    let url = api.apiObj.fontConversion.url;
    let dataObj = {
      key: api.apiObj.fontConversion.key,
      type:"2",
      text: this.data.value
    }
    
    server.GET(url, dataObj, this.showInfo)

  },
  showInfo(res) {
    console.log(res);
    this.setData({
      rTxt: res.outstr
    })
    
  }
})